import { request } from '@boeyo/portal';

/**
 * 关联监测结构的设备列表
 * null
 */
export const fetchList = (params) => {
  return request({
    url: '/monitoring/deviceList',
    method: 'GET',
    params,
  });
};

/**
 * 监测列表树形列表
 * null
 */
export const fetchStructureTree = (data = {}) => {
  return request({
    url: '/monitoring/tree',
    method: 'POST',
    data,
  });
};

/**
 * 获取设备型号下拉框数据
 */
export const getDeviceModelSelect = () => {
  return request({
    url: '/deviceModel/option',
    method: 'GET',
  });
};
/**
 * 获取设备厂商下拉框数据
 */
export const getDeviceManufacturerSelect = (params) => {
  return request({
    url: '/manufacturer/selectList',
    method: 'GET',
    params,
  });
};
/**
 * 获取设备所属项目下拉框数据
 */
export const getDeviceProjectSelect = () => {
  return request({
    url: '/project/selectList',
    method: 'GET',
  });
};
/**
 * 获取设备供电设备下拉框数据
 */
export const getDevicePowerSelect = () => {
  return request({
    url: '/powerSupply/selectList',
    method: 'GET',
  });
};

/**
 * 历史数据波形
 */
export const fetchHistoryData = (params) => {
  return request({
    url: 'deviceData/history',
    params,
  });
};
